package test.compiler;

import com.alibaba.fastjson.JSON;
import com.sun.tools.javac.*;
import org.junit.Test;

public class test {

    public static void main(String[] arag) throws Exception {
        arag = new String[]{"-processor", "com.tc.boost.tjvm.compiler.checker.NameCheckProcessor", "D:\\git\\boost\\tjvm\\src\\main\\java\\com\\tc\\boost\\tjvm\\compiler\\checker\\BADLY_NAME_CODE.java"};
        System.out.println(JSON.toJSONString(arag));
        Main.main(arag);//编译
        //JavaCompiler;

        boolean a = false;

        assert a : "";
    }

    @Test
    public void demo() throws Exception {

        String[] arag = new String[]{"-processor", "com.tc.boost.tjvm.compiler.ast.ForceAssertions", "D:\\git\\boost\\tjvm\\src\\main\\java\\com\\tc\\boost\\tjvm\\compiler\\ast\\ASSERT_CODE.java"};
        System.out.println(JSON.toJSONString(arag));
        Main.main(arag);//编译

    }

    @Test
    public void demo3() throws Exception {


        String aesKey = AESUtil.getAESKey();

        System.out.println(aesKey);

        byte[] 我是天才s = AESUtil.getAESEncode(aesKey, "我是天才");

        String aesDecode = AESUtil.getAESDecode(aesKey, 我是天才s);

        System.out.println(aesDecode);

    }


    @Test
    public void demo4() throws Exception {


        byte i= (byte) 127;

        System.out.println((int)i);

    }

}
